unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, PlayerUnit, ExtCtrls, GameUnit, common;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  g : Game;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var p : Player;
    arr : array of integer;
    i : integer;
begin
  N := 50;
  p := Player.Create;
  setlength(arr, N);
  for i := 0 to N-1 do
    arr[i] := 1+random(_HEIGHT-1);
  g := Game.Create(p, Image1, arr);
  Timer1.Enabled := true;
  g.Draw;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  g.Step;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  randomize;
end;

end.
